//
//  OSSNWOperation.h
//  NiuNiuLawyer
//
//  Created by 曾永强 on 3/7/16.
//  Copyright © 2016 Beyondsoft. All rights reserved.
//
//1. 图片: IMGyyyyMMddhh24mmss+用户ID.jpg/png,   缩略图直接在@100X100这样的参数就行了。
//2. 文件: FILEyyyyMMddhh24mmss+用户ID.word/excel...


#import <Foundation/Foundation.h>

#import <AliyunOSSiOS/OSSService.h>

#define kNSErrorCodeLosePara     509

typedef void(^OSSCompleteBlock)(BOOL isSuccess,NSError *error,NSString *url);

typedef NS_OPTIONS(NSUInteger, OSS_TYPE) {
    OSS_TYPE_UPLOAD = 0,    //上传
    OSS_TYPE_DOWNLOAD       //下载
};

typedef NS_OPTIONS(NSUInteger, OSS_REQUEST_METHOD) {
    OSS_REQUEST_METHOD_Async = 0,   //异步
    OSS_REQUEST_METHOD_Sync         //同步
};

typedef NS_OPTIONS(NSUInteger, OSS_REC_TYPE) {
    OSS_REC_TYPE_DATA = 0,          //data
    OSS_REC_TYPE_FILEPATH           //文件路径
};
@interface OSSNWOperation : NSObject

@property (nonatomic,strong) NSData *resouceData;//本地要上传的资源data

@property (nonatomic,strong) NSString *localFilePath;//本地要上传的资源文件路径

@property (nonatomic,strong) NSString *ossRemoteFileName;//上传后oss服务器上的文件名称 objectKey


/**
 如果希望Object直接下载到文件中，通过这个字段指明文件地址
 */
@property (nonatomic, strong) NSURL * downloadToFileURL;
@property (nonatomic, strong) NSString *downloadRemoteFileName;//要下载的资源文件名称 objectKey

/**
 回调下载进度
 */
@property (nonatomic, copy) OSSNetworkingDownloadProgressBlock downloadProgress;


/**
 上传进度回调
 */
@property (nonatomic, copy) OSSNetworkingUploadProgressBlock uploadProgress;
@property (nonatomic, copy) OSSCompleteBlock completeBlock;





//上传资源类型
@property (nonatomic,assign) OSS_REC_TYPE ossRecType;
//上传还是下载
@property (nonatomic,assign) OSS_TYPE ossType;
//上传同步异步方式
@property (nonatomic,assign) OSS_REQUEST_METHOD ossMethod;

- (void)sendRequest;

@end
